package com.zuilapsa.jmc.userInterfaces;

import org.dom4j.Element;

import com.zuilapsa.jmc.JmcException;
import com.zuilapsa.jmc.model.*;
import com.zuilapsa.jmc.userInterfaces.UserInterfaceSession;


public class FakedSession implements UserInterfaceSession {
	Level level;
	
	public void startStopping() {
		printMessageInfo("startStopping");
	}

	public Element getConfigElement() {
		return level.getConfigElement();
	}

	public Element getDefinitionElement() {
		return level.getDefinitionElement();
	}

	public Level getLevel() {
		return level;
	}

	public void setLevel(Level level) {
		this.level = level;
	}

	public Level getModel() {
		try {
			return Level.getRootInstance();
		} catch (JmcException e) {
			printMessageError(e.getMessage());
			return null;
		}
	}
	
	public void printMessageInfo(String message) {
		System.out.println("INFO: "+message);
	}

	public void printMessageWarning(String message) {
		System.out.println("WARNING: "+message);
	}

	public void printMessageError(String message) {
		System.out.println("ERROR: "+message);
	}

}
